home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / apps.to.go / Kibitz / Kibitz.make < prev    next >
Encoding:
Text File  |  1994-05-06  |  9.6 KB  |  250 lines  |  [TEXT/MPS ]

  1. #------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    MultiFinder-Aware Sample Application
  6. #
  7. #    Program:    Kibitz
  8. #    File:        Kibitz.make    -    Make Source
  9. #
  10. #    Copyright © 1988-1994 Apple Computer, Inc.
  11. #    All rights reserved.
  12. #
  13. #------------------------------------------------------------------------------
  14.  
  15. #    The are three possible ways of making Kibitz with this makefile
  16. #        1) 68K only
  17. #        2) PowerPC only
  18. #        3) "Fat" - both 68K and PowerPC
  19. #    You can control which gets build using the dependency line for "AppName"
  20. #    The default is to build the fat version.  See instructions below.
  21. AppName            =    'Kibitz'
  22. Signature        =    'KBTZ'
  23.  
  24. DTS.Lib.folder    =    "::DTS.Lib:"
  25. DTS.Lib.hdrs    =    "::DTS.Lib:DTS.Lib.headers:"
  26. projsrc            =    :
  27. obj                =     :OBJECT:
  28. objppc            =     :OBJECTPPC:
  29.  
  30. #------------------------------------------------------------------------------
  31. # Options for our compilers:
  32. #    -sym on: tells the compilers and linker to emit symbol information for
  33. #        a source level debugger, such as SADE.
  34. #    -i {DTS.Lib.hdrs}: means to look for any #include files in the specified
  35. #        directory, as well as the normal set.
  36. #    -r: tells the C compiler to require function prototypes.
  37. #    -mbg off: tells the compilers to not emit low-level debugger names. This
  38. #        saves on file space, but you may wish to remove this option if you
  39. #        need to debug with something like Macsbug.
  40. #    -rd: for Rez means to suppress warnings for redeclared types (we redeclare
  41. #        'RECT' because it’s not included in MPW 3.0).
  42. #    -append: means to add the resources to the target file, rather than
  43. #        deleting all the ones that are there first.
  44. #    -d Signature...: is a way of passing our application's signature to Rez.
  45. #        With this mechanism, we can define our signature here, and export
  46. #        it to Rez, so that we don't have to declare it there, too.
  47. #    -sn STDCLIB=Main: puts all the routines that would normally go into the
  48. #        STDCLIB segment into the Main segment. This is done so that when we
  49. #        call upon any low-level utilities, we don't potentially move memory
  50. #        by loading in a segment.
  51. #------------------------------------------------------------------------------
  52.  
  53. #    SymOptions and OptOptions are mutually exclusive.  Enable as appropriate
  54. SymOptions        =    -sym on                # turn this on to debug with SADE/R2Db
  55. COptOptions        =    #-opt on
  56. PPCCOptOptions    =    #-opt speed
  57.  
  58. # CIncludesFolder needs to be set to your Universal Interfaces folder
  59. CIncludesFolder    =    -i "{PPCCIncludes}"
  60. IncludesFolders    =    -i {DTS.Lib.hdrs}
  61. COptions        =    {IncludesFolders} {CIncludesFolder} {SymOptions} {COptOptions} -r -mbg on
  62. PPCCOptions        =    {IncludesFolders} {SymOptions} {PPCCOptOptions} -w conformance -appleext on
  63. RezOptions        =    {IncludesFolders} -rd -append -d Signature="{Signature}" -d AppName='"Kibitz"'
  64. LinkOptions        =    {SymOptions} {SegmentMappings} -msg nodup
  65. LinkOptionsPPC    =    {SymOptions} -main main
  66. MakeSymOptions    =    -i {DTS.Lib.folder} -r
  67. #    The -w options for MakePef makes those libraries "weak" imports, meaning
  68. #        they can be absent at runtime.  The app must check before calling them.
  69. MakePefOptions    =    -l QuickTimeLib.xcoff=QuickTimeLib~ ∂
  70.                         -w QuickTimeLib:EnterMovies ∂
  71.                         -l SpeechLib.xcoff=SpeechLib~ ∂
  72.                         -w SpeechLib:DisposeSpeechChannel ∂
  73.                         -w SpeechLib:NewSpeechChannel ∂
  74.                         -w SpeechLib:SetSpeechInfo ∂
  75.                         -w SpeechLib:SpeakText ∂
  76.                         -w SpeechLib:SpeechBusy ∂
  77.                         -w SpeechLib:StopSpeech ∂
  78.                         -l InterfaceLib.xcoff=InterfaceLib
  79. SegmentMappings    =    -sn INTENV=Main ∂
  80.                     -sn PASLIB=Main ∂
  81.                     -sn STDCLIB=Main ∂
  82.                     -sn SANELIB=Main ∂
  83.                     -sn StringUtils=Main ∂
  84.                     -sn UtilMain=Main
  85.  
  86. #------------------------------------------------------------------------------
  87. # These are modified default build rules.  This is necessary to take into
  88. # account differences between MPW 3.1 and 3.2
  89. #------------------------------------------------------------------------------
  90. {obj}            ƒ    {projsrc}
  91.  
  92. .c.o            ƒ    .c
  93.     {C} {COptions} {CAltOptions} {DepDir}{Default}.c -o {TargDir}{Default}.c.o
  94.  
  95. {objppc}        ƒ    {projsrc}
  96.  
  97. .o                ƒ    .c
  98.     PPCC {PPCCOptions} {DepDir}{Default}.c -o {TargDir}{Default}.o
  99.  
  100. #------------------------------------------------------------------------------
  101. # These are the objects that we want to link with. If any one of these
  102. # changes, then we invoke the Link command.
  103. #------------------------------------------------------------------------------
  104. AppObjects        =    ∂
  105.                     {obj}AEchess.c.o ∂
  106.                     {obj}AppleEvents.c.o ∂
  107.                     {obj}BoardSlider.c.o ∂
  108.                     {obj}Chess.c.o ∂
  109.                     {obj}CMQueenMate.c.o ∂
  110.                     {obj}CMRookMate.c.o ∂
  111.                     {obj}Config.c.o ∂
  112.                     {obj}DoCursor.c.o ∂
  113.                     {obj}DoEvent.c.o ∂
  114.                     {obj}EventLoop.c.o ∂
  115.                     {obj}File.c.o ∂
  116.                     {obj}GoToMove.c.o ∂
  117.                     {obj}Help.c.o ∂
  118.                     {obj}IdleTasks.c.o ∂
  119.                     {obj}Init.c.o ∂
  120.                     {obj}KibitzWindow.c.o ∂
  121.                     {obj}Menu.c.o ∂
  122.                     {obj}Notation.c.o ∂
  123.                     {obj}Offscreen.c.o ∂
  124.                     {obj}PPCBrowserOverride.a.o ∂
  125.                     {obj}PPCBrowserOverride.c.o ∂
  126.                     {obj}Print.c.o ∂
  127.                     {obj}SaveBoardImage.c.o ∂
  128.                     {obj}Setup.c.o ∂
  129.                     {obj}Sound.c.o ∂
  130.                     {obj}SpeechMessage.c.o ∂
  131.                     {obj}Start.c.o ∂
  132.                     {obj}Window.c.o
  133.  
  134. AppObjectsPPC    =    ∂
  135.                     {objppc}AEchess.o ∂
  136.                     {objppc}AppleEvents.o ∂
  137.                     {objppc}BoardSlider.o ∂
  138.                     {objppc}Chess.o ∂
  139.                     {objppc}CMQueenMate.o ∂
  140.                     {objppc}CMRookMate.o ∂
  141.                     {objppc}Config.o ∂
  142.                     {objppc}DoCursor.o ∂
  143.                     {objppc}DoEvent.o ∂
  144.                     {objppc}EventLoop.o ∂
  145.                     {objppc}File.o ∂
  146.                     {objppc}GoToMove.o ∂
  147.                     {objppc}Help.o ∂
  148.                     {objppc}IdleTasks.o ∂
  149.                     {objppc}Init.o ∂
  150.                     {objppc}KibitzWindow.o ∂
  151.                     {objppc}Menu.o ∂
  152.                     {objppc}Notation.o ∂
  153.                     {objppc}Offscreen.o ∂
  154.                     #{objppc}PPCBrowserOverride.a.o ∂
  155.                     #{objppc}PPCBrowserOverride.o ∂
  156.                     {objppc}Print.o ∂
  157.                     {objppc}SaveBoardImage.o ∂
  158.                     {objppc}Setup.o ∂
  159.                     {objppc}Sound.o ∂
  160.                     {objppc}SpeechMessage.o ∂
  161.                     {objppc}Start.o ∂
  162.                     {objppc}Window.o
  163.  
  164. #------------------------------------------------------------------------------
  165. # These help define the libraries that we want to link with. {AppObjects} holds
  166. # the names of the application units we want to link together. {Libs68K} and
  167. # {LibsPPC} hold the DTS.Lib and System library files we need to link with.
  168. #------------------------------------------------------------------------------
  169. Libs68K            =    ∂
  170.                     "{Libraries}Runtime.o" ∂
  171.                     "{DTS.Lib.folder}DTS.Lib_controls" ∂
  172.                     "{DTS.Lib.folder}DTS.Lib_strings" ∂
  173.                     "{DTS.Lib.folder}DTS.Lib_utils" ∂
  174.                     "{Libraries}Interface.o"
  175.  
  176. LibsPPC            =    ∂
  177.                     "{DTS.Lib.folder}DTS.Lib_controls.PPC" ∂
  178.                     "{DTS.Lib.folder}DTS.Lib_strings.PPC" ∂
  179.                     "{DTS.Lib.folder}DTS.Lib_utils.PPC" ∂
  180.                     "{PPCLibraries}"QuickTimeLib.xcoff ∂
  181.                     "{PPCLibraries}"SpeechLib.xcoff ∂
  182.                     "{PPCLibraries}"InterfaceLib.xcoff ∂
  183.                     "{PPCLibraries}"PPCCRuntime.o
  184.  
  185.  
  186. #------------------------------------------------------------------------------
  187. # Dependencies for the individual components. These will invoke the
  188. # default build rules listed in Chapter 9 of the MPW 3.0 manual.
  189. # You may wish to reduce the number of dependencies.  Two dependencies
  190. # you may wish to remove are this makefile and the Kibitz.protos file.
  191. # For the Kibitz.protos file, if you add a function to the list of
  192. # functions in Kibitz.protos, you will cause all the source files to be
  193. # recompiled.  This may be more than you want to wait for each time you
  194. # add a function to your application.  On the other hand, if you do not
  195. # include this in the dependencies, and you change the parameters for a
  196. # function, and make the respective change to Kibitz.protos, any files
  197. # that reference that function will not be recompiled.  If these files are
  198. # recompiled, the prototype checking will catch any cases where you did
  199. # not change the way the altered function was called.  <<You choose>>
  200. #------------------------------------------------------------------------------
  201.  
  202. {AppObjects}    ƒ    #{AppName}.make ∂
  203. #                    Kibitz.h ∂
  204. #                    Kibitz.protos
  205.  
  206. #    This rule controls how the final app is built.
  207. #    By depending on both App68K and AppPPC, the "fat" version
  208. #    gets built.  To build 68K only or PowerPC only, remove the other
  209. #    dependency.
  210. {AppName}            ƒƒ AppRez App68K AppPPC
  211.     SetFile {AppName} -t APPL -c {Signature} -a B
  212.  
  213. #------------------------------------------------------------------------------
  214. # Build rule that links our application together. If any of our objects 
  215. # changes, or this makefile changes, then we relink.  The dummy prerequisite
  216. # ShellForce must come before any other prerequisites for {AppName}
  217. #------------------------------------------------------------------------------
  218.  
  219. App68K                ƒ {AppObjects}
  220.     Link {LinkOptions} -o {AppName} {AppObjects} {Libs68K}
  221.     Rez {RezOptions} KibitzCfrg.r -o {AppName}
  222.  
  223. #------------------------------------------------------------------------------
  224. # Build rule that creates our resources and adds them to the application
  225. #------------------------------------------------------------------------------
  226.  
  227. AppRez                ƒ    {AppName}.make ∂
  228.                         Kibitz.r ∂
  229.                         KibitzCfrg.r ∂
  230.                         Kibitz.h
  231.     Rez {RezOptions} Kibitz.r KibitzCfrg.r -o {AppName}
  232.  
  233. #------------------------------------------------------------------------------
  234. # Rules to build the PowerPC part
  235. #------------------------------------------------------------------------------
  236. AppPPC                ƒ    {AppName}.pef
  237.  
  238. {AppName}.xcoff        ƒ    {AppObjectsPPC}
  239.     PPCLink {LinkOptionsPPC} {AppObjectsPPC} {LibsPPC} -o {AppName}.xcoff
  240.  
  241. #    MakeSym is very timeconsuming, so we only do it if we really need it
  242. {AppName}.xSYM        ƒ {AppName}.xcoff
  243.     IF "{SymOptions}" != ""    && "{SymOptions}" != "-sym off"                
  244.         MakeSym {MakeSymOptions} {AppName}.xcoff -o {AppName}.xSYM
  245.     END
  246.  
  247. {AppName}.pef        ƒ    {AppName}.xcoff {AppName}.xSYM
  248.     MakePef {MakePefOptions} {AppName}.xcoff -o {AppName}
  249.     Rez {RezOptions} -d powerc KibitzCfrg.r -o {AppName}
  250.